<template>
	<view class="u-page">
		<!-- 自定义导航栏 -->
		<u-navbar
			safeAreaInsetTop
			fixed
			placeholder
			:autoBack="true"
			:leftText="TA.nickName"
		>
		</u-navbar>
		
		<!-- 吸顶宝贝信息 -->
		<u-sticky>
			<!-- 头像 -->
			<!-- <view style="padding: 20px 10px 20px 20px;">
				<view class="u-demo-block">
					<view class="u-demo-block__content">
						<view class="u-page__image-item">
							<u--image shape="circle" :src="TA.icon" width="60px" height="60px"></u--image>
						</view>
					</view>
				</view>
			</view> -->
			<view style="height: 100px; width: 100%; border-bottom: 1px solid #e7e6e4;">
				<view style="padding: 10px; float: left;">
					<u--image :src="good.img_src" width="80px" height="80px" radius="5px"></u--image>
				</view>
				<view style="float: left;">
					<view style="margin: 15px;">
						<u--text mode="price" :text="good.price" size="24" bold color="#303133"></u--text>
					</view>
					<view style="margin-left: 22px;">
						<text style="font-size: 16px;">发布于: {{good.address}}</text>
					</view>
					
				</view>
				<view style="float: right; margin: 45px 20px 0 0;">
					<u-button text="立即购买" type="error" size="normal" shape="circle"></u-button>
				</view>

			</view>

		</u-sticky>
		
		<!-- 私信消息 -->
		<view>
			
		</view>
		
		<!-- 吸底框聊天框 -->
		<view
			style="position: fixed; right: 0; bottom: 0; z-index: 99;width: 100%; height: 80px; background-color: white;">
			<view style="padding: 10px 20px 10px 20px;">
				<view>
					<view>
						<view class="u-demo-block__content" style="margin-top: 0px;">
							<!-- 注意：由于兼容性，非nvue下需使用u-input -->
							<!-- #ifndef APP-NVUE -->
							<u-input placeholder="跟TA说些什么..." v-model="message" shape="circle">
							<!-- #endif -->
								<!-- #ifdef APP-NVUE -->
								<u--input placeholder="跟TA说些什么..." v-model="message" shape="circle">
								<!-- #endif -->
									<template slot="suffix">
										<u-button @tap="sendMessage" text="发送" type="success" size="normal"
											shape="circle"></u-button>
									</template>
							<!-- #ifndef APP-NVUE -->
							</u-input>
							<!-- #endif -->
							<!-- #ifdef APP-NVUE -->
							</u--input>
							<!-- #endif -->
						</view>
					</view>
		
				</view>
		
			</view>
		
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				chatShow: false,
				message: '',
				Tid: '', // 要联系的用户id
				Gid: '', // 私信来自的商品id
				TA: {
					id: '',
					nickName: '',
					icon: '',
					
				},
				good: {
					id: '',
					description: '',
					price: '',
					address: '',
					img_src: ''
				}
				
			}
		},
		methods: {
			sendMessage() {
				
			},
			messageBarHide() {
				this.chatShow = false;
			}
		},
		onLoad(option) {
			this.Tid = option.Tid;
			this.Gid = option.Gid;
			
			let that = this;
			uni.request({
				method: 'POST',
				url: getApp().globalData.url + '/good/lianXiTa',
				data: {
					Tid: this.Tid,
					Gid: this.Gid
				},
				success(res) {
					console.log(res.data)
					that.TA = res.data.data.TA;
					that.good = res.data.data.good;
				}
			})
		}
	}
</script>

<style lang="scss">
	/* #ifndef APP-NVUE */
	page {
		background-color: $u-bg-color;
	}
	/* #endif */
	
	.u-page {
		padding: 0;
		flex: 1;
		background-color: $u-bg-color;

		&__item {

			&__title {
				color: $u-tips-color;
				background-color: $u-bg-color;
				padding: 15px;
				font-size: 15px;

				&__slot-title {
					color: $u-primary;
					font-size: 14px;
				}
			}
		}
	}

	.u-nav-slot {
		@include flex;
		align-items: center;
		justify-content: space-between;
		border-width: 0.5px;
		border-radius: 100px;
		border-color: $u-border-color;
		padding: 3px 7px;
		opacity: 0.8;
	}
</style>
